﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Deanery.Controller.Directories;
using Deanery.Controller.StudyData;

namespace Deanery.View
{
    public partial class CreateNavchalnuyPlanForm : Form
    {
        public CreateNavchalnuyPlanForm()
        {
            InitializeComponent();
            FillComboBox();
        }
        
        public void FillComboBox()
        {
            var qualifObj = new QualificationController();
            cmbO_K_R.DataSource = qualifObj.GetAllQualificationName();

            var naprymObj = new NapryamController();
            cmbDirection.DataSource = naprymObj.GetNapryamName(qualifObj.FindGuidByName(cmbO_K_R.Text));

            var typeEduObj = new TypeEducationController();
            cmbEduForm.DataSource = typeEduObj.GetAllTypeEducationName();
        }

        private void cmbO_K_R_SelectedIndexChanged(object sender, EventArgs e)
        {
            var obj = new QualificationController();
            var naprymObj = new NapryamController();
            cmbDirection.DataSource = naprymObj.GetNapryamName(obj.FindGuidByName(cmbO_K_R.SelectedItem.ToString()));
        }
    }
}
